#ifndef H_CHAT_CHATMESSAGEHANDEL_H
#define H_CHAT_CHATMESSAGEHANDEL_H

#include "../util/util_macro.h"
#include "../core/map.h"
#include "../thirdparty/rapidjson/document.h"
#include "../net/session.h"

namespace QinChat{
    namespace Chat{
        class CChatMessageHandle{
            public:
                explicit CChatMessageHandle();
                ~CChatMessageHandle();

                virtual CChatMessageHandle* Clone() { return nullptr; }
                virtual bool HandelMessage(std::shared_ptr<Net::CSession> pSession, rapidjson::Document& doc);

            private:
                QinChat_Class_DelConstructed(CChatMessageHandle)

        };

        class CChatMessageHandleRegist{
            public:
                explicit CChatMessageHandleRegist(void);
                ~CChatMessageHandleRegist();

                void Regist(const std::string& type, CChatMessageHandle* pMessageHandel);
                CChatMessageHandle* GetMessageHandel(const std::string& type);

            private:
                
                Core::CMap<std::string,  CChatMessageHandle*> m_msgHanelTypes;

        };
    }
}

#endif // ! H_CHAT_CHATMESSAGEHANDEL_H